/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryPreOrder;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryPreOrderSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryPreOrder record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_pre_order");

                if (record.getSenderId() != null) {
                    VALUES("sender_id", "#{senderId,jdbcType=INTEGER}");
                }

                if (record.getRecipientsId() != null) {
                    VALUES("recipients_id", "#{recipientsId,jdbcType=INTEGER}");
                }

                if (record.getPackageKilo() != null) {
                    VALUES("package_kilo", "#{packageKilo,jdbcType=DOUBLE}");
                }

                if (record.getOriginalPrice() != null) {
                    VALUES("original_price", "#{originalPrice,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryPreOrder record) {
        return new SQL() {
            {
                UPDATE("delivery_pre_order");

                if (record.getSenderId() != null) {
                    SET("sender_id = #{senderId,jdbcType=INTEGER}");
                }

                if (record.getRecipientsId() != null) {
                    SET("recipients_id = #{recipientsId,jdbcType=INTEGER}");
                }

                if (record.getPackageKilo() != null) {
                    SET("package_kilo = #{packageKilo,jdbcType=DOUBLE}");
                }

                if (record.getOriginalPrice() != null) {
                    SET("original_price = #{originalPrice,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}